<!doctype html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <link rel="stylesheet" href="css/aui.css">
    <script type="text/javascript" src="js/jquery-3.3.1.min.js"></script>
    <script type="text/javascript" src="js/init.js"></script>
    <title>我的钱包</title>
</head>
<body>
<header>
    <a href="my.html" class="f1 head-back"></a>
    <div class="f8">我的钱包</div>
    <div class="f1"></div>
</header>
<section class="bg-gray">
    <div class="pad-3">
        <ul class="bg-white border-gray">
            <li class="flex pad-2-3 border-b-gray">
                <p class="f1"><b>$</b> 以太坊（ETH）</p>
                <p class="f1 color-green" id="ethmoney">0</p>
            </li>
            <li class="flex  pad-2-3 border-b-gray">
                <p class="f1"><b>$</b> 以太坊（锁）</p>
                <p class="f1 color-green" id="lockmoney">0</p>
            </li>
            <li class="flex  pad-2-3 border-b-gray">
                <p class="f1"><b>$</b> 盟主红利</p>
                <p class="f1 color-green" id="chiefmoney">0</p>
            </li>
            <li class="flex  pad-2-3 border-b-gray">
                <p class="f1"><b>$</b> 以太经典（ETC）</p>
                <p class="f1 color-green" id="etcmoney">0</p>
            </li>
            <li class="flex  pad-2-3 border-b-gray">
                <p class="f1"><b>$</b> ETH投资中</p>
                <p class="f1 color-green" id="ethinvest">0</p>
            </li>
            <li class="flex  pad-2-3 border-b-gray">
                <p class="f1"><b>$</b> ETC投资中</p>
                <p class="f1 color-green" id="etcinvest">0</p>
            </li>
            <a href="recharge.html" class="pad-2 border-b-gray block">
                <p class="col-8 auto bg-green color-white center pad-2 border-radius-1">充值</p>
            </a>
            <li class="pad-2 border-b-gray block" onclick="tixian()">
                <p class="col-8 auto bg-blue color-white center pad-2 border-radius-1">提现</p>
            </li>
            <li class="pad-2 border-b-gray block" onclick="isShowYi()">
                <p class="col-8 auto bg-yellow color-white center pad-2 border-radius-1">收益明细</p>
            </li>
        </ul>
    </div>
</section>

<script src="js/foot.js"></script>
<script>
    var data,min,max;
    new AjaxRequest({
        type: 'post',
        dataType: 'json',
        url: hostUrl + 'index/Mycenter/mywallet',
        data: data,
        callback: res => {
            if(res.status == 1){
                $("#ethmoney").text(res.data.eth);
                $("#etcmoney").text(res.data.etc);
                $("#lockmoney").text(res.data.chieflock);
                $("#chiefmoney").text(res.data.chief);
                $("#ethinvest").text(res.data.ethinvest);
                $("#etcinvest").text(res.data.etcinvest);
            }
        }
    });
    
    function tixian() {

        var data;
        new AjaxRequest({
            type: 'post',
            data: data,
            dataType: 'json',
            url: hostUrl + 'index/Withdraw/extractcheck',
            callback: res => {

                if(res.status == 1){
                    min = res.data.low_money;
                    max = res.data.big_money;
                    window.location.href = 'tixian.html?min=' + min + '&max=' +max;

                }else{
                    toast(res.msg);
                }

            }
        });
    }

    function isShowYi() {
        var data;
        new AjaxRequest({
            type: 'post',
            data: data,
            dataType: 'json',
            url: hostUrl + 'index/Mycenter/bonuscheck',
            callback: res => {

                if(res.status == 1){
                    window.location.href = 'myShouyi.html';

                }else{
                    toast(res.msg);
                }

            }
        });
    }

</script>
</body>
</html>